import java.util.Scanner;
public class Main{
  public static void main(String [] args){
    Scanner cin= new Scanner (System.in);
    String str=cin.nextLine();
    String [] strs = str.split(" ");
    int num=0;
    for (int i=0;i<strs.length;i++){
      if (!strs[i].trim().equals("")){
        num++;
      }
    }
    System.out.print(num);
  }
}